﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace WinHBM.Utils
{
    public class UtilMD5
    {

        public static string encodeString(string str)
        {
            var md5Csp = new MD5CryptoServiceProvider();
            byte[] md5Source = Encoding.UTF8.GetBytes(str);
            byte[] md5Out = md5Csp.ComputeHash(md5Source);
            string md5 = "";
            for (int i = 0; i < md5Out.Length; i++)
            {
                md5 += md5Out[i].ToString("x2");
            }
            return md5;
        }


    }
}
